import config from '../commonApi'
import qs from 'qs'

// 查询投注记录
const QUERY_RECORD = `${config.HOST}/slot/queryPagedSlotRecordDTOsByQueryParams`
//  获奖排行榜
const QUERY_SLOT = `${config.HOST}/slot/queryPagedSlotStatisticsPlayerDTOsByQueryParams`
// 建立邀请关系接口  |inviterAddress| 邀请者地址|是|   |inviteeAddress| 受邀者地址|是|
const BUILD_RELATION = `${config.HOST}/invite/buildRelation`
// 投注调用奖励挖矿接口  userAddress 钱包地址   amount 投注数量
const AWARD_MINING = `${config.HOST}/award/mining`
// 挖矿奖励信息获取(用于查看挖矿阶段信息)
const MINING_INFOS = `${config.HOST}/award/miningInfos`
// 平台公告
const GET_TOPIC = `${config.HOST}/plateform/topic`
// 平台公告详情
const TOPIC_DETAIL = `${config.HOST}/plateform/topicDetail`
// 邀请页
const GET_INFO = `${config.HOST}/invite/info`
// 跑马灯
const GET_MESSAGE = `${config.HOST}/plateform/message`
// 轮播图
const SWIPE_LIST = `${config.HOST}/plateform/slider`

export default {
  queryRecord: (paramJson) => {
    return config.axios.post(QUERY_RECORD, qs.stringify(Object.assign({}, config.params, paramJson)))
  },
  querySlot: (paramJson) => {
    return config.axios.post(QUERY_SLOT, qs.stringify(Object.assign({}, config.params, paramJson)))
  },
  buildRelation: (paramJson) => {
    return config.axios.post(BUILD_RELATION, qs.stringify(Object.assign({}, config.params, paramJson)))
  },
  awardMining: (paramJson) => {
    return config.axios.post(AWARD_MINING, qs.stringify(Object.assign({}, config.params, paramJson)))
  },
  miningInfos: () => {
    return config.axios.post(MINING_INFOS)
  },
  getTopic: (paramJson) => {
    return config.axios.post(GET_TOPIC, qs.stringify(Object.assign({}, config.params, paramJson)))
  },
  topicDetail: (paramJson) => {
    return config.axios.post(TOPIC_DETAIL, qs.stringify(Object.assign({}, config.params, paramJson)))
  },
  getInfo: (paramJson) => {
    return config.axios.post(GET_INFO, qs.stringify(Object.assign({}, config.params, paramJson)))
  },
  getMessage: () => {
    return config.axios.post(GET_MESSAGE)
  },
  swipeList: () => { // 轮播list
    return config.axios.post(SWIPE_LIST)
  }
}
